C (222/254)

From:Allan Odgaard
Date:03 Apr 00 at 19:55:04
Subject:Re: TCP online

On 03-Apr-00, mike.carter@ukonline.co.uk wrote:

> Would it be okay to attempt to open the bsdsocket.library (is this also
> made available from miami?) and then call some common function in that?

MIAMI.library has a function to tell wether or not the user is online (for a
given interface) -- so you may use this, and/or test if bsdsocket.library
could be opened. But that's about it, and you should only use it as a hint
and always allow the user to override your calculated result, as 'being
online' is not trivial to decide, e.g. he could be on a LAN or he could be
running AmiTCP/MIAMI with a local proxy and http server, which technically
doesn't mean he's online etc. etc.

For IProbe I also need to test wether the user is online, since if the user is
offline, *but* bsdsocket.library is available, many socket-functions would
spend ages on timeout or similar (can't recall exactly, but it was a problem!)
so it was better simply not to call them, and use the cache -- but I ended up
having the 'online query' as a settings page in the prefs, as too many testers
had "problems" with my auto detection. For example being offline and testing a
local http-server *should* cause IProbe to use socket library, despite what
one would normally expect...

Regards Allan